package no.sachmuld.methodcombination.examples.reflection.extendbehaviour.v2;

import no.sachmuld.methodcombination.api.MethodInvocation;
import no.sachmuld.methodcombination.api.reflection.Default;

/**
 *
 */
public class Bar extends Foo {

    public Bar() {
        with(new BarBehaviour() {

            @Override
            public void foo(MethodInvocation<Void> methodInvocation) {
                methodInvocation.proceed();
                System.out.println("Bar.foo");
            }

            @Override
            public void bar(MethodInvocation<Void> methodInvocation) {
                System.out.println("Bar.bar");
            }

        });
    }

    final public void bar() {
        new Default<Void>().build(BarBehaviour.class, Bar.class, "bar").execute(this, chain);
    }

}
